Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touch up init, fix missing adapter errors #3483

Merged
merged 2 commits into from
Jun 24, 2021
Merged

Conversation

jtcohen6
Copy link
Contributor

@jtcohen6 jtcohen6 commented Jun 21, 2021

resolves #2814
builds off #3474 (I'll rebase after that one is merged)

Description

dbt init will scaffold ~/.dbt/profiles.yml (if missing) using an adapter-specific profile. Neat! It accepts an --adapter flag to control which one. If unspecified, it would default to redshift — even if the Redshift adapter isn't installed. Not so neat.

Changes:

  • Remove redshift as default for --adapter. If --adapter is not specified, use _get_adapter_plugin_names to grab the set of installed adapters. Pick the first one and use it. (That method is currently in dbt.version, we could move it into dbt.utils.)
  • If sample_profiles.yml is missing in the selected adapter, don't raise a runtime error, just skip writing profiles.yml. Do the same if no adapters are installed.
  • I moved around some of the logging so it's directly tied to the action being performed, or skipped if the associated action is skipped.
  • While here, I also updated the link to community slack to https://community.getdbt.com/. Previously, it was There's a link to our Slack group in the GitHub Readme (meh). I'm assuming that the new-ish community link is relatively stable, and that if it were to change, we'd do a good job forwarding traffic to account for older versions of dbt. (@annafil Want to check with you first, of course!)

Checklist

  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt next" section.

@jtcohen6 jtcohen6 requested a review from leahwicz June 21, 2021 21:15
@cla-bot cla-bot bot added the cla:yes label Jun 21, 2021
Base automatically changed from leahwicz/starter-repo-move to develop June 22, 2021 15:03
@jtcohen6 jtcohen6 force-pushed the fix/init-adapter-missing branch from 541c5e9 to 520590b Compare June 24, 2021 02:04
@jtcohen6 jtcohen6 temporarily deployed to Redshift June 24, 2021 02:09 Inactive
@jtcohen6 jtcohen6 temporarily deployed to Redshift June 24, 2021 02:09 Inactive
@jtcohen6 jtcohen6 temporarily deployed to Bigquery June 24, 2021 02:09 Inactive
@jtcohen6 jtcohen6 temporarily deployed to Bigquery June 24, 2021 02:09 Inactive
@jtcohen6 jtcohen6 temporarily deployed to Postgres June 24, 2021 02:09 Inactive
@jtcohen6 jtcohen6 temporarily deployed to Snowflake June 24, 2021 02:09 Inactive
@jtcohen6 jtcohen6 temporarily deployed to Snowflake June 24, 2021 02:09 Inactive
@jtcohen6 jtcohen6 temporarily deployed to Snowflake June 24, 2021 19:29 Inactive
@jtcohen6 jtcohen6 temporarily deployed to Snowflake June 24, 2021 19:29 Inactive
@jtcohen6 jtcohen6 temporarily deployed to Redshift June 24, 2021 19:29 Inactive
@jtcohen6 jtcohen6 temporarily deployed to Redshift June 24, 2021 19:29 Inactive
@jtcohen6 jtcohen6 temporarily deployed to Postgres June 24, 2021 19:29 Inactive
@jtcohen6 jtcohen6 merged commit 41610b8 into develop Jun 24, 2021
@jtcohen6 jtcohen6 deleted the fix/init-adapter-missing branch June 24, 2021 19:51
iknox-fa pushed a commit that referenced this pull request Feb 8, 2022
* Some love to init

* Update changelog

automatic commit by git-black, original commits:
  41610b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dbt init --adapter default to the available adapter
2 participants